<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>数组分隔</title>
</head>

<body>
    <script>
        var array = ["aa", "bb", "cc", "dd", "ee"];
        var str = array[0];
        var seperator = "|";
        for (var i = 1; i < array.length; i++) {
            str = str + seperator + array[i];
        }
        console.log(str);
    </script>
</body>

</html>